<!DOCTYPE html>
<style>
#stacking {
  position: absolute;
  width: 200px;
  height: 200px;
  background-color: lightgreen;
}

#clipper {
  width: 100px;
  height: 100px;
  background-color: lightblue;
  z-index: -1;
}

.clipping {
  overflow: hidden;
}

#composited {
  position: relative;
  top: 50px;
  width: 100px;
  height: 100px;
  will-change: transform;
  background-color: salmon;
}

#squashed {
  position: relative;
  top: -50px;
  width: 100px;
  height: 100px;
  background-color: green;
}
</style>
<div id="stacking">
  <div id="clipper">
    <div id="composited"></div>
    <div id="squashed"></div>
  </div>
<div>
<pre></pre>
<script>
if (window.testRunner) {
  testRunner.dumpAsText();
} else {
  alert('This test require window.testRunner.')
}

internals.forceCompositingUpdate(document);
document.querySelector('#clipper').className = 'clipping';
internals.forceCompositingUpdate(document);
document.querySelector('#clipper').className = '';
internals.forceCompositingUpdate(document);

document.querySelector('#clipper').className = 'clipping';
document.querySelector('pre').textContent = internals.layerTreeAsText(document);
</script>
